import requests
import ssl
import json

url = "https://192.168.1.10:8080/configure"
payload={'data': '[{"op": "set", "path": ["protocols", "vrf", "purple", "static", "route", "172.16.2.0/24", "next-hop", "172.16.2.2", "next-hop-vrf", "blue" ]}, \
                   {"op": "set", "path": ["protocols", "vrf", "blue", "static", "route", "172.16.1.0/24", "next-hop", "172.16.1.2", "next-hop-vrf", "purple" ]}, \
                   {"op": "set", "path": ["protocols", "vrf", "purple", "static", "route", "0.0.0.0/0", "next-hop", "192.168.1.1", "next-hop-vrf", "default" ]}, \
                   {"op": "set", "path": ["protocols", "vrf", "default", "static", "route", "172.16.1.0/24", "next-hop", "172.16.1.2", "next-hop-vrf", "purple" ]}, \
                   {"op": "set", "path": ["protocols", "vrf", "blue", "static", "route", "172.16.3.0/24", "next-hop", "172.16.3.2", "next-hop-vrf", "green" ]}, \
                   {"op": "set", "path": ["protocols", "vrf", "green", "static", "route", "172.16.2.0/24", "next-hop", "172.16.2.2", "next-hop-vrf", "blue" ]} ]',
            'key': 'PS-HTTPS-API-PLAINTEXT-KEY'}
headers = {}
response = requests.request("POST", url, headers=headers, data=payload, verify=False)
print(response.text)


